<%@ include file="/WEB-INF/jsp/includes.jsp" %>
<%@ include file="/WEB-INF/jsp/header.jsp" %>

<h2>Buddys
<c:if test="${ sessionScope.user != null}"> of ${sessionScope.user.nickname }</c:if>:</h2>

<p style="color: red; font-size: 9px;">${msg}</p>
<p>&nbsp;</p>

<h4>Pending Buddy Request List</h4>
<table>
  <thead>
    <th>Requester_id</th>
    <th>Reason</th>
    <th>Send_Time</th>
    <th></th>
  </thead>
  <c:forEach var="req" items="${pendingBuddyRequestList}">
    <tr>
      <td>${req.requester_id}</td>
      <td>${req.reason}</td>
      <td>${req.send_datetime}</td>
      <td><a href="accecptBuddyReq?req_id=${req.id}">accecpt</a>&nbsp;&nbsp;<a href="declineBuddyReq?req_id=${req.id}">decline</a></td>
    </tr>
  </c:forEach>
</table>

<h4>Historical Buddy Request List</h4>
<table>
  <thead>
    <th>Requester_id</th>
    <th>Reason</th>
    <th>Send_Time</th>
    <th>conclusion</th>
  </thead>
  <c:forEach var="req" items="${histBuddyRequestList}">
    <tr>
      <td>${req.requester_id}</td>
      <td>${req.reason}</td>
      <td>${req.send_datetime}</td>
      <c:choose>    
       <c:when test="${req.confirm == 1}">
          Accecpted
       </c:when>       
       <c:otherwise>
          Declined
       </c:otherwise>     
    </c:choose>
    </tr>
  </c:forEach>
</table>

<%@ include file="/WEB-INF/jsp/footer.jsp" %>
